package fr.umlv.projet.android.submit;

import android.app.IntentService;
import android.content.Intent;
import android.widget.Toast;
import fr.umlv.projet.android.utils.ServerHelper;

public class SubmitService extends IntentService{

	public SubmitService() {
		super("Submit Service");
	}

	@Override
	protected void onHandleIntent(Intent intent) {
		String exam = intent.getStringExtra("exam");
		String data = intent.getStringExtra("data");
		try {
			ServerHelper.submitResponse(exam, data);
		} catch (Exception e) {
			Toast.makeText(getBaseContext(), "Error when submit answer", Toast.LENGTH_SHORT).show();
		}
	}

}
